import * as monaco from "monaco-editor";
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
// import { language, conf } from 'monaco-editor/esm/vs/basic-languages/python/python'
// @ts-ignore
self.MonacoEnvironment = {
  getWorker(_, label) {
    return new editorWorker();
  },
};

// function createDependencyProposals(range) {
//   // returning a static list of proposals, not even looking at the prefix (filtering is done by the Monaco editor),
//   // here you could do a server side lookup
//   return [
//     {
//       label: ''lodash-es'',
//       kind: monaco.languages.CompletionItemKind.Keyword,
//       documentation: "basic-languages/python/python",
//       commitCharacters: language.keywords,
//       range: range,
//     },
//   ];
// }

// monaco.languages.registerCompletionItemProvider("python", {
//   provideCompletionItems: (model, position) => {
//     var word = model.getWordUntilPosition(position);
//     var range = {
//       startLineNumber: position.lineNumber,
//       endLineNumber: position.lineNumber,
//       startColumn: word.startColumn,
//       endColumn: word.endColumn,
//     };
//     return {
//       suggestions: createDependencyProposals(range),
//     };
//   },
// });

// // compiler options
// monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
// 	target: monaco.languages.typescript.ScriptTarget.ES6,
// 	allowNonTsExtensions: true
// });

monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
